package com.handinfo.uimenu.window;

/**
 * 处理界面
 * @author venizeng
 * 
 */
public abstract class IWindowHandler
{
	public int m_state;
	public int m_index;
	public int m_groupId;
	public int m_groupIndex;

	/**
	 * 获得从属的组
	 */
	public abstract int countGroupId();

	/**
	 * 获得在组中的索引
	 */
	public abstract int countGroupIndex(int groupId);

	/**
	 * 修改当前状态
	 * @param state_new
	 */
	public void changeState(int state_new)
	{
		if (m_state == state_new) {
			return;
		}
		m_state = state_new;
		actionOnStateChanged();
	}

	public void actionOnStateChanged()
	{
		
	}

	/*
	 * 修改当前焦点显示位置
	 */
	public void changeIndex(int index_new)
	{
		if (m_index == index_new) {
			return;
		}
		m_index = index_new;
		m_groupId = countGroupId();
		m_groupIndex = countGroupIndex(m_groupId);
		actionOnIndexChanged();
	}

	public void actionOnIndexChanged()
	{
	}

}
